<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Headhunt_model extends MY_Model
{

	public function getHeadhuntList(){
        $sql = "SELECT * FROM ym_headhunt  ORDER BY sort_order DESC";
        $query = $this->db->query($sql);
        $result =$query->result_array();
        return $result;
    }


    

     //编辑
    public function editHeadhunt($id,$data = array()){
        if($id){
            $this->db->where("id",$id);
            $res = $this->db->update("ym_headhunt",$data);
        }else{
            $res = $this->db->insert("ym_headhunt",$data);
        }
        return $res;
    }

    public function delNews($id){
        $this->db->where("newsID",$id);
        $data = array(
            'isDel'=>1
        );
        $res = $this->db->update("yy_news",$data);
        return $res;
    }

     //根据id获取广告信息
    public function getHeadhuntInfobyID($id){
        $this->db->where("id",$id);
        $query = $this->db->get("ym_headhunt");
        return $query->row_array();
    }

}


